export function empty(data) {
	
}

export function checkObjLen(data){
	if (!data) return false;
	
	if(Object.keys(data).length > 0){
		return true
	}else{
		return false
	}
}

export function goTo(url, options) {
	
	let keys = Object.keys(options);
	if (keys.length > 0) {
		let query = '';
		for(let i in options) {
			query +=  '+' + i + '=' + options[i];
		}
		url = url + '?' + query.substring(1);
	}
	
	uni.navigateTo({
		url: url
	});
}
//检测数组是否包含  JavaScript Array includes() 对于类型格式较严 
export function include(target, arr){
	 return arr.find(ele => ele == target)
}

//include(4,arr=[1,3,"4"])
export function _includes(arr, target) {
    for (var item of arr) {
        if (item == target) return true;
    }
    return false;
}
//_includes(arr=[1,3,"4"],4)

export function myIndexOf(item,arr){
	return arr.indexOf(item)>0 || arr.indexOf(item +'')>0
	
}
	//myIndexOf(5,arr=[1,2,3,'5'])